home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / IIGS / TN.IIGS.085 < prev    next >
Encoding:
Text File  |  1990-08-23  |  2.3 KB  |  49 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. Apple IIgs
  7. #85:    Moving the Mouse
  8.  
  9. Written by:    Matt Deatherage                                      July 1990
  10.  
  11. This Technical Note discusses moving the cursor on the screen without touching 
  12. the mouse.
  13. _____________________________________________________________________________
  14.  
  15. It is sometimes desirable to programmatically move the QuickDraw II cursor on 
  16. the screen without requiring the user to touch the mouse.  This can be 
  17. effective, for example, in tutorial software that actually shows mouse actions 
  18. such as pulling down menus and dragging windows.
  19.  
  20. There is not an easy or obvious way to do this in the toolbox.  This is not a 
  21. bad thing; it prevents overzealous programmers from zapping the mouse all over 
  22. the screen for suspicious reasons.  You must remember that the mouse belongs 
  23. to the user, not to the application.  If the user has put the mouse somewhere, 
  24. it should only be a user's action that causes the cursor to move elsewhere.  
  25. Most of the time that action is touching the mouse and physically moving it.  
  26. Do not move the mouse except in response to a user-initiated command.
  27.  
  28. The most obvious way to move the mouse position--calling PosMouse with the new 
  29. mouse position--is not sufficient; PosMouse does not update the current mouse 
  30. position.  When the mouse is next moved, a mouse interrupt comes through and 
  31. the new deltas are added to the old mouse position, resulting in correct 
  32. ReadMouse results after the mouse has been physically moved.  Also, PosMouse 
  33. does not update the cursor on the screen.
  34.  
  35. Faking Out the System 
  36.  
  37. When you wish to move the mouse yourself, you are in effect replacing (or 
  38. adding to) the standard mouse with a small programmatic mouse substitute--your 
  39. code.  This qualifies as a "device" and can be considered an Event Manager 
  40. "device driver."  You can then make the appropriate Event Manager call, 
  41. FakeMouse.  When calling FakeMouse, you supply all the mouse information 
  42. yourself, allowing you to move the mouse, simulate button presses, and in 
  43. general replace the mouse.
  44.  
  45. Further Reference
  46. _____________________________________________________________________________
  47.   o  Apple IIgs Toolbox Reference, Volumes 1-3
  48.  
  49.